<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>loop js test</title>
</head>
<body>
<script>
    var fruits = ["AA", "BB", "Pear", "Apple"];
    alert(fruits);
    for (var i = 0; i < fruits.length; i++) {
        document.write(fruits[i] + "<br>")
    }

</script>
</body>
</html>